
#ifndef __SQLITE_AUTO_LOCK_H
#define __SQLITE_AUTO_LOCK_H

#include "SQLiteLockCounter.h"

/** An automated recursive mutex locking class for the SQLite
 * database. */
class SQLiteAutoLock
{
   public:
      SQLiteAutoLock(sqlite3_mutex *idbmutex);
      ~SQLiteAutoLock();
      SQLiteAutoLock(const SQLiteAutoLock &o);
      SQLiteAutoLock &operator=(const SQLiteAutoLock &o);
   private:
      void deleteAtReferenceCountZero();
      void copy(const SQLiteAutoLock &o);
      /** SQLite counter and lock pointer wrapped class. */
      SQLiteLockCounter *lockpntr;
};

#endif
